Skip to content

Retain atomic class for bare atomic inputs on collection - #68

Open
LJ-Jenkins wants to merge 9 commits into
r-lib:mainfrom
LJ-Jenkins:retain-atomic-class
Open

Retain atomic class for bare atomic inputs on collection#68
LJ-Jenkins wants to merge 9 commits into
r-lib:mainfrom
LJ-Jenkins:retain-atomic-class

Conversation

@LJ-Jenkins

Copy link
Copy Markdown

Closes #67

I was playing around with retaining class without changing too much code, but it ended up opening a bit of a can of worms in my head around which objects should be unlisted vs which shouldn't, which attributes should be preserved vs dropped, and where the line is between "destructuring" and "restructuring".

As I see it, there are three possible approaches here:

  • All collections go into a list. If the input is a vector, then return a vectorizable list (current behaviour).
  • Same as above, but collections of bare atomic vectors unlist.
  • All collections retain (most/or the key) attributes of the input.

I think all three approaches have their own pros and cons but I imagine 3 would go against the longstanding zeallot behaviour. This PR is an implementation of option 2, but I'm happy to leave it to you to decide which direction makes the most sense overall.

(Also, note that this was branched off PR #66.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Retain class for collected elements when the input is atomic

1 participant